<?php
require_once '../sub/init.php';
require_once 'chkUadm.php';
if(!in_array('u',$QXARR))exit(noauth());
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'m/div_left_so.php';
switch ($submitok) {
	case 'flagmod':
		if (!ifint($uid))json_exit(array('flag'=>0,'msg'=>'您要操作的用户不存在或已经删除'));
		$flag = intval($flag);$photo_ifshow=intval($photo_ifshow);
		$row = $db->ROW(__TBL_USER__,"nickname,flag","id=".$uid,'num');
		if(!$row){
			json_exit(array('flag'=>0,'msg'=>'您要操作的用户不存在或已经删除'));
		}else{
			$nickname= $row[0];$oldflag= $row[1];
			switch($oldflag){
				case"-1":$newflag=1;break;
				case"-2":$newflag=1;break;
				case"2":$newflag=1;break;
				case"0":$newflag=1;break;
				case"1":$newflag=-1;break;
			}
			AddLog('(手机)修改用户【'.$nickname.'（uid:'.$uid.'）】帐号状态，原状态：'.flagtitle($oldflag).' -> '.'新状态【'.flagtitle($newflag).'】');
			//
			$db->query("UPDATE ".__TBL_USER__." SET flag=$flag,photo_ifshow=$photo_ifshow WHERE id=".$uid);
			//json_exit(array('flag'=>$newflag,'title'=>flagtitle($newflag),'msg'=>'操作成功'));
			json_exit(array('flag'=>1,'msg'=>'操作成功'));
		}
	break;
	case 'modflag':
		if (!ifint($uid))json_exit(array('flag'=>0,'msg'=>'您要操作的用户不存在或已经删除'));
		$row = $db->ROW(__TBL_USER__,"nickname,flag","id=".$uid,'num');
		if(!$row){
			json_exit(array('flag'=>0,'msg'=>'您要操作的用户不存在或已经删除'));
		}else{
			$nickname= $row[0];$oldflag= $row[1];
			$SQL = "";
			switch($oldflag){
				case"-1":$SQL="flag=1";$newflag=1;break;
				case"-2":$SQL="flag=1";$newflag=1;break;
				case"2":$SQL="flag=1";$newflag=1;break;
				case"0":$SQL="flag=1";$newflag=1;break;
				case"1":$SQL="flag=-1";$newflag=-1;break;
			}
			AddLog('(手机)修改用户【'.$nickname.'（uid:'.$uid.'）】帐号状态，原状态：'.flagtitle($oldflag).' -> '.'新状态【'.flagtitle($newflag).'】');
			//
			$db->query("UPDATE ".__TBL_USER__." SET ".$SQL." WHERE id=".$uid);
			json_exit(array('flag'=>$newflag,'title'=>flagtitle($newflag),'msg'=>'操作成功'));
		}
	break;
	case 'utext':
		if (!ifint($uid))json_exit(array('flag'=>0,'msg'=>'亲，用户不存在'));
		$C = get_udata_text($uid);
		if(!empty($C)){
			json_exit(array('flag'=>1,'C'=>$C));
		}else{
			json_exit(array('flag'=>0,'msg'=>'用户不存在'));
		}
	break;
}
$_ZEAI['pagesize']= 10;
//$fields    = "id,sex,grade,photo_s,photo_f,RZ,love,birthday,edu,pay,job,heigh,photo_ifshow,areatitle,nickname,regtime,myinfobfb,regkind,tguid,flag,subscribe";没加文本复制之前
$fields  = "id,grade,photo_s,photo_f,RZ,photo_ifshow,regtime,myinfobfb,regkind,tguid,flag,subscribe,mob";
$fields .= ",nickname,sex,birthday,areatitle,area2title,love,child,heigh,weigh,edu,pay,house,car,blood,pay,blood,job,marrytime,companykind,smoking,drink,marrytime,aboutus";
$fields .= ",mate_age1,mate_age2,mate_heigh1,mate_heigh2,mate_weigh1,mate_weigh2,mate_pay,mate_edu,mate_love,mate_car,mate_house,mate_areaid,mate_areatitle,mate_job,mate_child,mate_marrytime,mate_companykind,mate_smoking,mate_drink,mate_areaid2,mate_areatitle2,mate_other";
$ZEAI_SQL  = " kind<>4 ";
$ORDER     = " ORDER BY id DESC ";
$nodatatips="<div class='nodatatips'><i class='ico'>&#xe608;</i>暂时木有符合条件的用户</div>";

switch ($f) {
	case -1:$ZEAI_SQL .= " AND flag=-1";break;
	case -2:$ZEAI_SQL .= " AND flag=-2";break;
	case 1:$ZEAI_SQL  .= " AND flag=1";break;
	case 2:$ZEAI_SQL  .= " AND flag=2";break;
}
if($g == 2){
	$ZEAI_SQL .= " AND grade>1";
	if(ifint($ugrade))$ZEAI_SQL .= " AND grade=$ugrade";
}

switch ($t) {
	case 'ext':
		$keyword = trimhtml(dataIO($keyword,'out'));
		if (!empty($keyword)){
			if (ifmob($keyword)){
				$ZEAI_SQL .= " AND (mob='$keyword' OR mob2='$keyword') ";
			}elseif(ifint($keyword)){
				$ZEAI_SQL .= " AND id='$keyword' ";
			}else{
				$ZEAI_SQL .= " AND nickname LIKE '%".$keyword."%' ";
			}
		}else{
			$sex=trimhtml(dataIO($sex,'out'));if(!empty($sex))$ZEAI_SQL .= doinsql('sex',$sex);
			$photo_s=intval($photo_s);if ($photo_s == 1)$ZEAI_SQL .= " AND photo_s<>'' AND photo_f=1 ";
			$areaid=trimhtml(dataIO($areaid,'out'));
			$area2id=trimhtml(dataIO($area2id,'out'));
			$areaid=getareaSQL($areaid);
			$area2id=getareaSQL($area2id);
			if(!empty($areaid))$ZEAI_SQL .= " AND areaid LIKE '%".$areaid."%' ";
			if(!empty($area2id))$ZEAI_SQL .= " AND area2id LIKE '%".$area2id."%' ";
			//age
			$age=trimhtml(dataIO($age,'out'));
			if(!empty($age)){
				$V=explode(',',$age);
				$V1=intval($V[0]);$V2=intval($V[1]);
				if(ifint($V1))$ZEAI_SQL .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) >= '$V1' ) ";
				if(ifint($V2))$ZEAI_SQL .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) <= '$V2' ) ";
			}
			//heigh
			$heigh=trimhtml(dataIO($heigh,'out'));
			if(!empty($heigh)){
				$V=explode(',',$heigh);$V1=intval($V[0]);$V2=intval($V[1]);
				if (ifint($V1))$ZEAI_SQL .= " AND ( heigh >= '$V1' ) ";
				if (ifint($V2))$ZEAI_SQL .= " AND ( heigh <= '$V2' ) ";
			}
			//weigh
			$weigh=trimhtml(dataIO($weigh,'out'));
			if(!empty($weigh)){
				$V=explode(',',$weigh);$V1=intval($V[0]);$V2=intval($V[1]);
				if (ifint($V1))$ZEAI_SQL .= " AND ( weigh >= '$V1' ) ";
				if (ifint($V2))$ZEAI_SQL .= " AND ( weigh <= '$V2' ) ";
			}
			//edu
			$edu=intval($edu);if(!empty($edu))$ZEAI_SQL .= " AND ( edu >= '$edu' ) ";
			//pay
			$pay=intval($pay);if(!empty($pay))$ZEAI_SQL .= " AND ( pay >= '$pay' ) ";
			//job
			$job=trimhtml(dataIO($job,'out'));if(!empty($job))$ZEAI_SQL .= doinsql('job',$job);
			//love
			$love=trimhtml(dataIO($love,'out'));if(!empty($love))$ZEAI_SQL .= doinsql('love',$love);
			//child
			$child=trimhtml(dataIO($child,'out'));if(!empty($child))$ZEAI_SQL .= doinsql('child',$child);
			//house
			$house=trimhtml(dataIO($house,'out'));if(!empty($house))$ZEAI_SQL .= doinsql('house',$house);
			//nation
			$nation=trimhtml(dataIO($nation,'out'));if(!empty($nation))$ZEAI_SQL .= doinsql('nation',$nation);
			//car
			$car=trimhtml(dataIO($car,'out'));if(!empty($car))$ZEAI_SQL .= doinsql('car',$car);
			//marrytime
			$marrytime=trimhtml(dataIO($marrytime,'out'));if(ifint($marrytime))$ZEAI_SQL .= " AND marrytime='$marrytime' ";
		}
	break;
}
$par = "&sex=".$sex."&photo_s=".$photo_s."&areaid=".$areaid."&area2id=".$area2id."&age=".$age."&heigh=".$heigh."&weigh=".$weigh."&edu=".$edu."&pay=".$pay."&job=".$job."&love=".$love."&child=".$child."&house=".$house."&car=".$car."&marrytime=".$marrytime."&nation=".$nation."&g=".$g."&f=".$f;

$ZEAI_SELECT="SELECT $fields FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL.$ORDER;
$TP=getTP($ZEAI_SQL);$ZEAI_total=$TP[0];$ZEAI_totalP=$TP[1];

$cs = "t=".$t."&showtype=".$showtype."&keyword=".$keyword.$par;
if($submitok=='ZEAI_list'){exit(Zeai_ajax_list_fn($ZEAI_totalP,$p));}

$nav='m_u';
$FT=json_decode(FT,true);
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/udata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/areadata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/zeai_div_area.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="js/m_u.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>zeai_ios_select/separate/select.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ulist{margin:70px auto}
.ulist li{width:95%;margin:0 auto 15px auto;border-radius:8px;background-color:#fff;box-shadow:0 0 24px rgb(0 0 0 / 8%);}
.ulist li .uidbox{padding:0 10px;margin:0 auto;line-height:40px;border-bottom:#f5f5f5 1px solid;}
.ulist li .uidbox .tg_str{text-align:right;color:#999}
.ulist li .uinfo{padding:0 10px;text-align:left;position:relative}
.ulist li .uinfo img.photo_s{border-radius:33px;width:50px;height:50px;object-fit:cover;-webkit-object-fit:cover;position:absolute;left:10px;top:22px}
.ulist li .uinfo .myinfobfb{position:absolute;left:15px;top:62px;text-align:center;font-size:12px;width:40px;line-height:16px;border-radius:15px;background-color:#fff;border:#eee 1px solid;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.myinfobfb0{color:#999}
.myinfobfb1{color:#f70}
.myinfobfb2{color:#090}
.ulist li .uinfo em{padding:25px 0 0 60px;color:#666}
.ulist li .uinfo em h5{margin-bottom:5px;color:#000}
.ulist li .uinfo em h5 img{vertical-align:middle}
.ulist li .uinfo em h5 span{vertical-align:middle;display:inline-block;width:60%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ulist li .uinfo em h5 .RZBOX{vertical-align:middle;}
.ulist li .uinfo em h5 .RZBOX i{font-size:14px;border-radius:3px;margin:0 2px;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.ulist li .uinfo em h6{line-height:20px;margin-left:3px;font-size:13px}
.ulist li .uinfo em h6.areatitle{line-height:12px;margin-top:8px}
.ulist li .uinfo em h6 b{color:#f2f2f2;margin:0 6px;font-weight:normal}
.ulist li .uinfo .reg{font-size:12px;color:#999;margin-top:8px;padding:10px 0}
.ulist li .uinfo .uflag{position:absolute;right:0;top:8px;line-height:22px;font-size:12px;padding:0 7px 0 10px;color:#fff;border-radius:12px 0 0 12px;border:#fff 1px solid;border-right:0}
.ulist li .uinfo .uflag_1{border-color:#00f;color:#00f}
.ulist li .uinfo .uflag_2{border-color:#666;color:#666}
.ulist li .uinfo .uflag0{border-color:#FD9F23;color:#FD9F23}
.ulist li .uinfo .uflag1{border-color:#5EB87B;color:#5EB87B}
.ulist li .uinfo .uflag2{border-color:#aaa;color:#aaa}
.ulist li .uinfo .utg{position:absolute;right:0;top:50px;font-size:12px;color:#999}

.ulist li .ubtnbox{line-height:48px;height:48px;text-align:right}
.ulist li .ubtnbox span{margin-left:10px;font-size:12px;color:#999;text-align:left}
.ulist li .ubtnbox .btn{margin:5px 10px 0 0}
.ulist li .ubtnbox a:first-child{margin-left:10px}

#backtop a{background-color:#fff;color:<?php echo $_ADM['color'];?>}
.top_mini4{background-color:<?php echo $_ADM['color'];?>}
.radioskin:checked + label.radioskin-label b{color:<?php echo $_ADM['color'];?>}
.radioskin:checked + label.radioskin-label i{border-color:<?php echo $_ADM['color'];?>}
.radioskin:checked + label.radioskin-label i:before{background-color:<?php echo $_ADM['color'];?>}

a.so{position:fixed;top:0;right:15px;text-align:center;line-height:50px;/*color:<?php echo $_ADM['color'];?>;*/;color:#fff;z-index:3}
a.so i{line-height:30px;height:30px;font-size:28px;display:block;margin-top:4px}
a.so span{line-height:20px;height:20px;display:block;font-size:12px;margin-top:-8px}
/*div_left_so*/
.div_left_so a.ed,
.div_left_so a.ed:after{color:<?php echo $_ADM['color'];?>}
.div_left_so ul.def li.ed{color:<?php echo $_ADM['color'];?>;background-color:rgba(<?php echo c16_rgb($_ADM['color']);?>,.1)}
.div_left_so .listbox dl dd span.ed{color:<?php echo $_ADM['color'];?>;border-top-color:<?php echo $_ADM['color'];?>}
.div_left_so_areabox .ul dt.ed{color:<?php echo $_ADM['color'];?>;border-top-color:<?php echo $_ADM['color'];?>}
.div_left_so_areabox .ul li a.ed{color:<?php echo $_ADM['color'];?>;background-color:rgba(<?php echo c16_rgb($_ADM['color']);?>,.1)}
.areabox .ul li a{position:relative;color:#666;background-color:#f7f7f7;height:30px;line-height:30px;margin:5px 5px;overflow:hidden;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;border:0;padding:0 8px}
.areabox .ul li a:hover:before,.areabox .ul li a.ed:before{position:absolute;font-family:"www_zeai_cn_iconfont" !important;content:"\e64a";width:15px;height:15px;line-height:15px;font-size:16px;right:0;bottom:0}
.areabox .ul li a.ed{border-radius:3px 3px 0 3px}
.areabox .ul dt.ed{border-top-color:<?php echo $_ADM['color'];?>;color:<?php echo $_ADM['color'];?>}
.areabox .ul li a.ed{background-color:<?php echo $_ADM['color'];?>;}
.ios-select-widget-box header.iosselect-header a.sure{background-color:<?php echo $_ADM['color'];?>;}
</style>
</head>
<body>
<?php 
$mini_title='用户列表';
//$mini_class='top_mini4 zeaibg bgcolor';
$mini_class='top_mini4 bgcolor';	
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="m_u.php" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="keyword" type="text" class="input" id="keyword" maxlength="20" value="<?php echo $keyword;?>" placeholder="按用户UID/昵称/手机" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		div_left_so_out(array('tbody'=>'注册状态','t'=>'f','tv'=>$f,'subkind'=>2,'newarr'=>json_decode('[{"i":"1","v":"注册成功"},{"i":"-2","v":"已隐藏"},{"i":"2","v":"注册未完成"},{"i":"-1","v":"已锁定/注销"}]'),'ulcls'=>' col3'));
		div_left_so_out(array('tbody'=>'用户等级','t'=>'g','tv'=>$g,'subkind'=>3,'newarr'=>json_decode('[{"i":"2","v":"VIP会员"}]'),'ulcls'=>' col2'));
		
		div_left_so_out(array('tbody'=>$FT['sex']['t'],'t'=>'sex','tv'=>$sex,'subkind'=>3,'newarr'=>json_decode($_UDATA['sex']),'ulcls'=>' col3'));//性别
        div_left_so_out(array('tbody'=>$FT['photo_s']['t'],'t'=>'photo_s','tv'=>$photo_s,'subkind'=>2,'newarr'=>json_decode('[{"i":"1","v":"有头像"}]'),'ulcls'=>' col3'));//头像
		//默认值
		function range_str($F,$V) {
			if(empty($V))return '';
			global $_UDATA;
			$FARR=explode(',',$V);
			$F1=$FARR[0];$F2=$FARR[1];
			$F_UDATA=json_decode($_UDATA[$V],true);
			$F_str = mateset_out($F1,$F2,$F_UDATA['dw']);
			$F_str = str_replace("不限","",$F_str);
			return $F_str;
		}
        ?>
        <div class="listbox"><dl id="age" data="<?php echo (empty($age))?'23,24':$age;?>" class="rang"><dt>年龄范围</dt><dd><span><?php echo range_str('age',$age);?></span></dd></dl></div>
        <input type="hidden" id="form_age" name="age" value="<?php echo $age;?>">
        <div class="listbox"><dl id="heigh" data="<?php echo (empty($heigh))?'160,175':$heigh;?>" class="rang"><dt>身高范围</dt><dd><span><?php echo range_str('heigh',$heigh);?></span></dd></dl></div>
        <input type="hidden" id="form_heigh" name="heigh" value="<?php echo $heigh;?>">
        <div class="listbox"><dl id="weigh" data="<?php echo (empty($weigh))?'50,70':$weigh;?>" class="rang"><dt>体重范围</dt><dd><span><?php echo range_str('weigh',$weigh);?></span></dd></dl></div>
        <input type="hidden" id="form_weigh" name="weigh" value="<?php echo $weigh;?>">
        <!--地区-->
        <!--gz-->
        <div id="areabox" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
        <input type="hidden" id="form_areaid" name="areaid" value="<?php echo $areaid;?>">
        <input type="hidden" id="form_areatitle" name="areatitle" value="<?php echo $areatitle;?>">
        <div class="listbox">
            <dl id="areaid" data="<?php echo $areaid;?>"><dt>工作地</dt><dd><span id="areatitle"><?php echo $areatitle;?></span></dd></dl>
        </div>
        <!--hj-->
        <div id="areabox2" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
        <input type="hidden" id="form_area2id" name="area2id" value="<?php echo $area2id;?>">
        <input type="hidden" id="form_area2title" name="area2title" value="<?php echo $area2title;?>">
        <div class="listbox">
            <dl id="area2id" data="<?php echo $area2id;?>"><dt>户籍地</dt><dd><span id="area2title"><?php echo $area2title;?></span></dd></dl>
        </div>
        <input type="hidden" name="t" value="ext">
        <input type="hidden" name="showtype" value="<?php echo $showtype;?>">
        <!--地区结束-->
        <?php
        div_left_so_out(array('tbody'=>$FT['nation']['t'],'t'=>'nation','tv'=>$nation,'subkind'=>3,'newarr'=>json_decode($_UDATA['nation']),'ulcls'=>' col3','show'=>'off'));//民族
        div_left_so_out(array('tbody'=>$FT['love']['t'],'t'=>'love','tv'=>$love,'subkind'=>3,'newarr'=>json_decode($_UDATA['love']),'ulcls'=>' col3','show'=>'off'));//婚况
        div_left_so_out(array('tbody'=>$FT['child']['t'],'t'=>'child','tv'=>$child,'subkind'=>3,'newarr'=>json_decode($_UDATA['child']),'ulcls'=>' col3','show'=>'off'));//小孩
        div_left_so_out(array('tbody'=>'最低'.$FT['edu']['t'],'t'=>'edu','tv'=>$edu,'subkind'=>2,'newarr'=>json_decode($_UDATA['edu']),'ulcls'=>' col3','show'=>'off'));//学历
        div_left_so_out(array('tbody'=>'最低'.$FT['pay']['t'],'t'=>'pay','tv'=>$pay,'subkind'=>2,'newarr'=>json_decode($_UDATA['pay']),'ulcls'=>' col3','show'=>'off'));//收入
        div_left_so_out(array('tbody'=>$FT['job']['t'],'t'=>'job','tv'=>$job,'subkind'=>3,'newarr'=>json_decode($_UDATA['job']),'ulcls'=>' col3','show'=>'off'));//职业
        div_left_so_out(array('tbody'=>$FT['house']['t'],'t'=>'house','tv'=>$house,'subkind'=>3,'newarr'=>json_decode($_UDATA['house']),'ulcls'=>' col2','show'=>'off'));//房
        div_left_so_out(array('tbody'=>$FT['car']['t'],'t'=>'car','tv'=>$car,'subkind'=>3,'newarr'=>json_decode($_UDATA['car']),'ulcls'=>' col2','show'=>'off'));//车
        div_left_so_out(array('tbody'=>$FT['marrytime']['t'],'t'=>'marrytime','tv'=>$marrytime,'subkind'=>2,'newarr'=>json_decode($_UDATA['marrytime']),'ulcls'=>' col3','show'=>'off'));//结婚时间	
        ?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 ico" style="background-color:<?php echo $_ADM['color'];?>">&#xe6c4; 确定</button></div>
    </form>
</div>
<!--div_left_so end-->

<div class="ulist" id="ZEAI_list"><?php if($ZEAI_totalP>0){echo Zeai_ajax_list_fn($ZEAI_totalP,$p);}else{echo $nodatatips;}?></div>
<script>var scs='<?php echo trimhtml($cs); ?>';</script>
<?php if ($ZEAI_total > $_ZEAI['pagesize']){?>
<script>
var ZEAI_totalP = parseInt(<?php echo $ZEAI_totalP; ?>);
var postjson = {submitok:'ZEAI_list',ZEAI_totalP:ZEAI_totalP};
if(!zeai.empty(scs))Object.assign(postjson,tojson(scs.split('&')));
zeaiOnscroll_json={url:'m_u'+zeai.extname,data:postjson};
</script>
<script src="<?php echo RES;?>m/js/zeai_loading_data.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php }?>

<?php
function rows_ulist($rows,$p) {
	global $db,$_ZEAI,$_INDEX,$zeai_cn,$t;
	$uid       = $rows['id'];
	$sex       = $rows['sex'];
	$grade     = $rows['grade'];
	$photo_s   = $rows['photo_s'];
	$photo_f   = $rows['photo_f'];
	$heigh     = $rows['heigh'];
	$job       = $rows['job'];
	$love      = $rows['love'];
	$pay       = $rows['pay'];
	$edu       = $rows['edu'];
	$heigh     = $rows['heigh'];
	$areatitle = $rows['areatitle'];
	$birthday  = $rows['birthday'];
	$myinfobfb = $rows['myinfobfb'];
	$flag      = $rows['flag'];
	$photo_ifshow = intval($rows['photo_ifshow']);
	$regtime   = YmdHis($rows['regtime']);
	$tguid     = $rows['tguid'];
	$nickname  = trimhtml(dataIO($rows['nickname'],'out'));
	$age = getage($rows['birthday']);
	$regkind = $rows['regkind'];
	$subscribe= $rows['subscribe'];
	$mob      = $rows['mob'];
	$RZ = $rows['RZ'];
	if(!empty($photo_s) ){
		$photo_s_url = UP.$photo_s;
	}else{
		$photo_s_url = RES.'photo_m'.$sex.'.png';
	}
	$href=mHref('u',$uid);
	$areatitle_str = (empty($areatitle))?'':'<span>'.$areatitle.'</span>';
	if($myinfobfb >80){$myinfobfb_cls = ' myinfobfb2 ';}elseif($myinfobfb >20){$myinfobfb_cls = ' myinfobfb1';}else{$myinfobfb_cls = ' myinfobfb0';}
	$unifo1='';
	$unifo1 .= ($age<=0)?'':$age.'岁';
	$unifo1 .= (empty($love))?'':'<b>|</b>'.udata('love',$love);
	$unifo1 .= (empty($heigh))?'':'<b>|</b>'.udata('heigh',$heigh);
	$unifo1  = ltrim($unifo1,'<b>|</b>');
	$unifo1 .= (empty($edu))?'':'<b>|</b>'.udata('edu',$edu);
	$unifo1 .= (empty($pay))?'':'<b>|</b>'.udata('pay',$pay);
	$unifo1  = ltrim($unifo1,'|');
	$areatitle_str .= (empty($job))?'':'<b>|</b>'.udata('job',$job);
	//
	switch ($regkind) {
		case 1:$regkind_str  = 'PC注册';break;
		case 2:$regkind_str  = 'PC微信扫码';break;
		case 3:$regkind_str  = '微信关注';break;
		case 4:$regkind_str  = 'QQ登录';break;
		case 5:$regkind_str  = '新浪微博';break;
		case 6:$regkind_str  = $openid_str.'手机端注册';break;
		case 7:$regkind_str  = '微信小程序';break;
		case 8:$regkind_str  = '手机APP';break;
		case 9:$regkind_str  = (ifint($admid))?'录入认领：<font class="C666">'.$admname.'(ID:'.$admid.')</font>':'人工录入';break;
		case 10:
			if(ifint($admid)){
				$regkind_str = '二维码认领：<font class="C666">'.$admname.'(ID:'.$admid.')</font>';
			}
		break;
		case 11:
			$regkind_str  = (ifint($admid))?'<font class="C666">'.$admname.'(ID:'.$admid.')</font>':'';
			$regkind_str  = '表单采集-'.$regkind_str; 
		break;
		case 12:$regkind_str  = 'Excel导入';break;
		case 13:$regkind_str  = '马甲APP'.'(ID:'.$magapp_uid.')';break;
		default:$regkind_str = '未知';break;
	}
	//
	$tg_str = '';
	if (ifint($tguid)){
		$tgrow = $db->ROW(__TBL_TG_USER__,"nickname,title,kind,tgmoney","id=".$tguid,"name");
		if ($tgrow){
			$nickname_tg = dataIO($tgrow['nickname'],'out');
			$title_tg    = $tgrow['title'];
			$kind_tg     = $tgrow['kind'];
			$tgmoney_tg     = $tgrow['tgmoney'];
			if($kind_tg==2 || $kind_tg == 3){
				$nickname_tg=$title_tg;
			}
			$tg_str = '　<span>推广员：'.$nickname_tg.'(ID:'.$tguid.')';
			if($tgflag==0)$tg_str .= ' <font class="Cf60">未验证</font>';
			$tg_str .= '</span>';
		}
	}
	//
	$rz_str = '';
	if(!empty($RZ))$rz_str = RZ_html($RZ,'s','color');
	$myinfobfb_str = '<span class="myinfobfb'.$myinfobfb_cls.'">'.$myinfobfb.'%</span>';
	switch ($flag) {
		case -1:$cls = ' uflag_1';$ut=flagtitle(-1);break;
		case -2:$cls = ' uflag_2';$ut=flagtitle(-2);break;
		case 0:$cls  = ' uflag0';$ut=flagtitle(0);break;
		case 1:$cls  = ' uflag1';$ut=flagtitle(1);break;
		case 2:$cls  = ' uflag2';$ut=flagtitle(2);break;
	}
	if($photo_ifshow!=1)$ut.=' ┆ 头像已隐藏';
	$mob_str=(ifmob($mob))?'<font class="C999">（'.$mob.'）</font>':'';
	$uflag_str = '<a id="u'.$uid.'" href="javascript:uflag('.$uid.','.$flag.','.$photo_ifshow.');" class="uflag'.$cls.'">'.$ut.'</a>';
	$O   = '<li>';
	$O  .= '	<div class="uidbox">';
	$O  .= '		<div class="uid FL">ID：'.$uid.$mob_str.'</div>';
	$O  .= '		<div class="tg_str">'.$tg_str.'</div>';
	$O  .= '		<div class="clear"></div>';
	$O  .= '	</div>';
	$O  .= '	<div class="uinfo">';
	$O  .= '		<a href="'.mHref('crm_u',$uid).'"><img class="photo_s" src="'.$photo_s_url.'"></a>
					<em>
						<a href="'.$href.'"><h5>'.uicon($sex.$grade).'<span>'.$nickname.$rz_str.'</span></h5></a>
						<h6 style="min-height:20px">'.$unifo1.$unifo2.'</h6>
						<h6 class="areatitle">'.$areatitle_str.'</h6>
					</em>
					'.$uflag_str.$myinfobfb_str;
					
	if($subscribe==0){
		$gzgzh = '';
	}elseif($subscribe==1){
		$gzgzh = ' 公众号：<i class="ico S14 C090">&#xe6b1;</i>';
	}else{
		$gzgzh = ' 公众号：<span class="C00f">取消</span>';
	}
					
	$O  .= '		<div class="reg">'.$regkind_str.'（'.$regtime.'）'.$gzgzh.'</div>';
					
	$O  .= '	</div>';
	$O  .= '	<div class="ubtnbox">';
	$O  .= '		<a href="javascript:utext(\''.get_udata_text($rows).'\');" class="btn size2 BAI FL">文本卡</a>';
	$O  .= '		<a href="'.HOST.'/m/my_card.php?uid='.$uid.'" class="btn size2 BAI FL">相亲卡</a>';
	$O  .= '		<a href="m_u_mod.php?submitok=mod&uid='.$uid.'" class="btn size2 BAI umod FR ico">修改资料</a>';
	if(ADMQX('u_del'))$O  .= '<a href="javascript:udel(\''.$uid.'\');" class="btn size2 BAI FR">删除</a>';
	$O  .= '		<div class="clear"></div>';
	$O  .= '	</div>';
	$O  .= '</li>';
	return $O;
}
function getTP($TJ,$moretb=false) {
	global $_ZEAI,$db;
	if($moretb){
		$rt = $db->query("SELECT COUNT(*) FROM (".$TJ.") ZEAI__cn_SQL");$row = $db->fetch_array($rt,'num');
	}else{
		$rt = $db->query("SELECT COUNT(*) FROM (SELECT id FROM ".__TBL_USER__." WHERE ".$TJ." LIMIT ".$_ZEAI['limit'].") ZEAI__cn_SQL");$row = $db->fetch_array($rt,'num');
	}
	$total=$row[0];
	return array($total,ceil($total/$_ZEAI['pagesize']));
}?>


<form id="GYLform_flag" style="padding:10px 20px;display:none;text-align:left">
<div style="margin-bottom:10px;font-size:15px">帐号状态</div>
　<input type="radio" name="flag" value="1" id="flag1" class="radioskin"><label for="flag1" class="radioskin-label"><i class="i1"></i><b class="W50">正常</b></label>
　<input type="radio" name="flag" value="-2" id="flag_2" class="radioskin"><label for="flag_2" class="radioskin-label"><i class="i1"></i><b class="W50">隐藏</b></label>
　<input type="radio" name="flag" value="-1" id="flag_1" class="radioskin"><label for="flag_1" class="radioskin-label"><i class="i1"></i><b class="W100">锁定(已注销)</b></label><br><br>
　<input type="radio" name="flag" value="0" id="flag0" class="radioskin"><label for="flag0" class="radioskin-label"><i class="i1"></i><b class="W50">未审</b></label>
　<input type="radio" name="flag" value="2" id="flag2" class="radioskin"><label for="flag2" class="radioskin-label"><i class="i1"></i><b class="W100">注册未完成</b></label><br><br>
<div style="margin:10px 0;font-size:15px">前台头像</div>
　<input type="radio" name="photo_ifshow" value="1" id="photo_ifshow1" class="radioskin"><label for="photo_ifshow1" class="radioskin-label"><i class="i1"></i><b class="W100">显示</b></label>　
<input type="radio" name="photo_ifshow" value="0" id="photo_ifshow0" class="radioskin"><label for="photo_ifshow0" class="radioskin-label"><i class="i1"></i><b class="W100">隐藏</b></label>


<br><br>
<input type="hidden" name="submitok" value="flagmod">
<button type="button" class="btn size3 W100_" id="flagsave" style="background-color:<?php echo $_ADM['color'];?>">保存</button>
</form>

<script>
function uflag(uid,flag,photo_ifshow){
//	var id = o('u'+uid);
//	zeai.ajax('m_u'+zeai.ajxext+'submitok=modflag&uid='+uid,function(e){var rs=zeai.jsoneval(e);
//		if (rs.flag == 1){id.class('uflag uflag1');id.html(rs.title);}else if(rs.flag == -1){id.class('uflag uflag_1');id.html(rs.title);}else{zeai.msg(rs.msg);}
//	});
	var obj = document.getElementsByName('flag');
	for(var k = 0;k<obj.length;k++){
		if (obj[k].value==flag){obj[k].checked=true;}
	}
	var obj2 = document.getElementsByName('photo_ifshow');
	for(var k2 = 0;k2<obj2.length;k2++){
		if (obj2[k2].value==photo_ifshow){obj2[k2].checked=true;}
	}
	ZeaiM.div2({obj:GYLform_flag,title:'修改【'+uid+'】帐号状态:',w:30,h:29});
	flagsave.onclick=function(){
		zeai.ajax({url:'m_u'+zeai.ajxext+'uid='+uid,form:GYLform_flag},function(e){var rs=zeai.jsoneval(e);
			zeai.msg(rs.msg);
			if (rs.flag == 1)setTimeout(function(){location.reload(true);},1000);
		});
	}
}
function udel(uid){
	zeai.confirm('确定要删除【uid:'+uid+'】么？删除后将无法恢复',function(){
		zeai.ajax('u'+zeai.ajxext+'submitok=alldel&list='+uid,function(e){var rs=zeai.jsoneval(e);
			zeai.msg(rs.msg);if (rs.flag == 1){setTimeout(function(){location.reload(true);},1000);}
		});
	});
}
function utext(uid){
	zeai.copy(uid,function(){zeai.msg('《个人资料》复制成功<br>您可以粘贴分享给好友啦');});
	return false;
	zeai.ajax('m_u'+zeai.ajxext+'submitok=utext&uid='+uid,function(e){var rs=zeai.jsoneval(e);
		if (rs.flag == 1){
			zeai.copy(rs.C,function(){zeai.msg('《个人资料》复制成功<br>您可以粘贴分享给好友啦');})
		}else{
			zeai.msg(rs.msg);
		}
	});
}
</script>
<?php require_once 'm_btm.php';?>